package edu.colorado.cs.correll.cudroplet.shaperecognition;

import java.util.HashSet;

import processing.core.PApplet;

public class TestSwarm extends Swarm {
	@SuppressWarnings("unchecked")
	public TestSwarm(ShapeRecognition shapeRecognition) {
		this.shapeRecognition = shapeRecognition;

		robots = new TestRobot[10];
		neighbors = new HashSet[robots.length];
		for (int i = 0; i < robots.length; i++) {
			int len = (i % 2 == 0) ? 40 : 50;
			robots[i] = new TestRobot(shapeRecognition, i,
					shapeRecognition.width / 2 + len
							* PApplet.cos(PApplet.radians(i * 20)),
					shapeRecognition.height / 2 + len
							* PApplet.sin(PApplet.radians(i * 20)), 0);
		}
	}

	@Override
	public void update() {
		updateRobots();
		updateNeighbors();
		calcSubgraphs();
	}
}
